export const getItem = (name)=>{
    var data = window.localStorage.getItem(name)
    try{
        return JSON.parse(data)
    }catch (err){
        return data

    }

}
export const setItem = (name,value)=>{
    var newValue
    if (typeof value === "object") {
         newValue = JSON.stringify(value)
        
    }else {
        newValue = value
    }
    

    window.localStorage.setItem(name,newValue)


}
export const removeItem = (name)=>{
    window.localStorage.removeItem(name)


}